package com.ruoyi.sale.service.impl;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sale.mapper.SaleMapper;
import com.ruoyi.sale.domain.Sale;
import com.ruoyi.sale.service.ISaleService;

/**
 * 商品销售Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-26
 */
@Service
public class SaleServiceImpl implements ISaleService 
{
    @Autowired
    private SaleMapper saleMapper;

    /**
     * 查询商品销售
     * 
     * @param id 商品销售主键
     * @return 商品销售
     */
    @Override
    public Sale selectSaleById(Integer id)
    {
        return saleMapper.selectSaleById(id);
    }

    /**
     * 查询商品销售列表
     * 
     * @param sale 商品销售
     * @return 商品销售
     */
    @Override
    public List<Sale> selectSaleList(Sale sale)
    {
        return saleMapper.selectSaleList(sale);
    }

    /**
     * 新增商品销售
     * 
     * @param sale 商品销售
     * @return 结果
     */
    @Override
    public int insertSale(Sale sale)
    {
        return saleMapper.insertSale(sale);
    }

    /**
     * 修改商品销售
     * 
     * @param sale 商品销售
     * @return 结果
     */
    @Override
    public int updateSale(Sale sale)
    {
        return saleMapper.updateSale(sale);
    }

    /**
     * 批量删除商品销售
     * 
     * @param ids 需要删除的商品销售主键
     * @return 结果
     */
    @Override
    public int deleteSaleByIds(Integer[] ids)
    {
        return saleMapper.deleteSaleByIds(ids);
    }

    /**
     * 删除商品销售信息
     * 
     * @param id 商品销售主键
     * @return 结果
     */
    @Override
    public int deleteSaleById(Integer id)
    {
        return saleMapper.deleteSaleById(id);
    }

    @Override
    public Integer statisOrder() {
        return saleMapper.statisOrder();
    }

    @Override
    public BigDecimal statisTotalPrice() {
        return saleMapper.statisTotalPrice();
    }

    @Override
    public  List<Integer> getAllSalesOrderedByTime() {
        return saleMapper.getAllSalesOrderedByTime();
    }

    @Override
    public List<Integer> getAllTotalByTime() {
      return   saleMapper.getAllTotalByTime();
    }

    @Override
    public List<Integer> getAllSalesOrder() {
        return saleMapper.getAllSalesOrder();
    }
}
